home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / vgakit52.zip / VGAKIT.DOC < prev    next >
Text File  |  1992-10-22  |  10KB  |  363 lines

  1. VGAKIT Version 5.2b
  2.  
  3. Here is my latest SVGA/VGA info pack. I've included the .OBJ versions in case
  4. anyone who does not have an assembler wants to play with these routines.
  5.  
  6. 5.0 Changes:
  7.  
  8. Support for VESA defined line widths, and correct support for bank sizes other
  9. than 64k. Old versions of VGAKIT would adjust all bank boundries to 64k by
  10. shifting up the bank numbers on cards that have 4k or 16k banks. To correct
  11. this I've changed the code to use an address table for screen offsets and
  12. bank numbers, this is very close to what I do in my own graphics code. To
  13. simplify things I've made the address table a fixed array that supports up
  14. to 1024 scanlines. In a real program I would probably allocate this array
  15. at runtime using malloc or some similar memory allocation function. 
  16.  
  17. 5.2 Changes:
  18.  
  19. New VESA memory detect
  20. VESA 1.2 support
  21. Memory detect for Tseng3000
  22. DAC Type call added
  23. More accurate Tseng4000 detect
  24.  
  25. 5.2b Changes:
  26.  
  27. DAC detect call for Tseng4000 boards would hang many other boards
  28.   now it is only made on Tseng4000 boards
  29.  
  30. MKADRTBL function would not handle bank sizes less than 64k correctly
  31.  
  32. VESASET function would not get the bank size correctly (it was using Winsize
  33.   instead of WinGranularity
  34.  
  35.  
  36. John Bridges  10/22/1992
  37.  
  38. Compuserve ID: John Bridges [GRASP] 75300,2137
  39. Internet: 75300.2137@compuserve.com (John Bridges)
  40.  
  41. I can be found regularly in the GRAPHVEN forum on Compuserve (where GRASP is
  42. supported), as well as the GRAPHSUP forum (formally called PICS).
  43.  
  44. -------------------------------------------------------------------------------
  45.  
  46.  
  47.  The included modules are:
  48.  
  49.  
  50. EXAMPLE.C    is a silly C program which shows that this code works,
  51.         it just plots a nice calculated pattern using the
  52.         point functions.
  53.  
  54.  
  55. MKEXAMP.BAT    batch file to compile and link EXAMPLE.C into EXAMPLE.EXE
  56.         for Microsoft C 6.0
  57.  
  58. STICKS.C    is another silly C program which shows that this code works,
  59.         it uses the line function to draw a LOT of lines to make a
  60.         very nice complex weave type pattern. Amazing how complex the
  61.         image gets from such a trivial program.
  62.  
  63.  
  64. MKSTICKS.BAT    batch file to compile and link STICKS.C into STICKS.EXE
  65.         for Microsoft C 6.0
  66.  
  67.  
  68. BANKS.ASM    SVGA bank switch code, used to address the beyond 64k
  69.         addressing sceams of the various SVGA chipsets. Also
  70.         includes a global variable "curbk" which is the current
  71.         hardware bank number which can be checked before each
  72.         bank switch to prevent the extra overhead of switching
  73.         into a currently selected bank. An example of this is
  74.         in the point routine in POINT.ASM which only switches
  75.         memory banks when required.
  76.                  BANKS.ASM includes the global variables ativga,tseng, tseng4
  77.         trident,video7,everex,paradise,chipstech, aheada, aheadb,
  78.         oaktech and vgamem. These variables are set by the WHICHVGA()
  79.         function which must be called at program startup time to
  80.         determine which SVGA (if any) you have installed. This
  81.         function returns a 1 (true) if you have a SVGA card installed.
  82.         
  83.  
  84. MODE13X.ASM    Is the function to setup the non-standard (ie: not supported
  85.         by the BIOS) 360x480x256 mode, this mode works on virtually
  86.         VGA that is fully IBM compatable. It's a great mode for
  87.         those without SVGA capabilities.
  88.  
  89. SVGAMODE.ASM    Is a limited function which sets up 640x480x256 color
  90.         mode on a SVGA, it uses the global chipset flags to
  91.         determine the BIOS mode number.
  92.  
  93. POINT.ASM    Is a pair of simple point plotting functions,
  94.  
  95.           point(xpos,ypos,color)
  96.  
  97.         which plots a point at x,y coorinates xpos,ypos in SVGA
  98.         modes calling newbank() in BANKS.ASM to switch memory
  99.         banks when necessary.
  100.  
  101.           point13x(xpos,ypos,color)
  102.  
  103.         which plots a point at x,y coorinates xpos,ypos in 360x480
  104.         mode.  Both point functions will clip at screen boundries
  105.         correctly.
  106.  
  107.  
  108. XPOINT.ASM    Is just like POINT.ASM except that it's point functions draw
  109.         the points XOR'd to the screen.
  110.  
  111.           xpoint(xpos,ypos,color)
  112.           xpoint13x(xpos,ypos,color)
  113.  
  114.  
  115. RDPOINT.ASM    Is just like POINT.ASM except that instead of plotting points
  116.         it reads the color of screen pixel.
  117.  
  118.           color=rdpoint(xpos,ypos)
  119.           color=rdpoint13x(xpos,ypos)
  120.  
  121. LINE.ASM    Is a line plotting function callable from C, you pass it the
  122.         coordinates for the two end points of the line, the color to
  123.         draw the line in and the function to call to plot each point.
  124.  
  125.           bline(x1,y1,x2,y2,color,xpoint);
  126.  
  127.  
  128. here is a list of VGA Chipset producers and their BIOS mode numbers:
  129.  
  130. =======================================================
  131.  
  132. ACUMOS
  133. ------
  134.         width        height        colors 
  135.         -----        ------        ------ 
  136. 0x59          800           600             2 
  137. 0x58          800           600            16 
  138. 0x5e          640           400           256 
  139. 0x5f          640           480           256 
  140. 0x5c          800           600           256 
  141. 0x5d         1024           768            16 
  142.  
  143. AX=MODE
  144.  
  145. =======================================================
  146.  
  147. AHEAD
  148. -----
  149.         width        height        colors 
  150.         -----        ------        ------ 
  151. 0x6A          800           600            16 
  152. 0x71          800           600            16 
  153. 0x74         1024           768            16 
  154. 0x60          640           400           256 
  155. 0x61          640           480           256 
  156. 0x62          800           600           256 
  157. 0x63         1024           768           256 
  158.  
  159. AX=MODE
  160.  
  161. =======================================================
  162.  
  163. ATI
  164. ---
  165.         width        height        colors 
  166.         -----        ------        ------ 
  167. 0x54          800           600            16 
  168. 0x65         1024           768            16 
  169. 0x61          640           400           256 
  170. 0x62          640           480           256 
  171. 0x63          800           600           256 
  172. 0x64         1024           768           256 
  173.  
  174. AX=MODE
  175.  
  176. =======================================================
  177.  
  178. CHIPS & TECH
  179. ------------
  180.         width        height        colors 
  181.         -----        ------        ------ 
  182. 0x70          800           600            16 
  183. 0x72         1024           768            16 
  184. 0x78          640           400           256 
  185. 0x79          640           480           256 
  186. 0x7b          800           600           256 
  187.  
  188. AX=MODE
  189.  
  190. =======================================================
  191.  
  192. EVEREX
  193. ------
  194.         width        height        colors 
  195.         -----        ------        ------ 
  196. 0x01          752           410            16
  197. 0x02          800           600            16 
  198. 0x11         1280           350             4
  199. 0x12         1280           600             4
  200. 0x13          640           350           256
  201. 0x14          640           400           256 
  202. 0x15          512           480           256
  203. 0x20         1024           768            16 
  204. 0x30          640           480           256 
  205. 0x31          800           600           256 
  206. 0x32         1024           768           256 
  207.  
  208. AX=0x70 BL=MODE
  209.  
  210. =======================================================
  211.  
  212. GENOA GVGA
  213. ----------
  214.         width        height        colors 
  215.         -----        ------        ------ 
  216. 0x7c              512           512            16
  217. 0x59              720           512            16
  218. 0x79 or 0x6a      800           600            16 
  219. 0x7d              512           512            256
  220. 0x5b              640           350            256
  221. 0x7e              640           400            256
  222. 0x5c              640           480            256
  223. 0x5d              720           512            256
  224. 0x5e or 0x6c      800           600            256
  225. 0x7f             1024           768            4
  226. 0x5f             1024           768            16 
  227.  
  228. AX=MODE
  229.  
  230. =======================================================
  231.  
  232. NCR
  233. ---
  234.         width        height        colors 
  235.         -----        ------        ------ 
  236. 0x59          800           600             2 
  237. 0x58          800           600            16 
  238. 0x5e          640           400           256 
  239. 0x5f          640           480           256 
  240. 0x5c          800           600           256 
  241. 0x5a         1024           768             2 
  242. 0x5d         1024           768            16 
  243.  
  244. AX=MODE
  245.  
  246. =======================================================
  247.  
  248. OAK TECH
  249. --------
  250.         width        height        colors 
  251.         -----        ------        ------ 
  252. 0x52          800           600            16 
  253. 0x53          640           480           256 
  254. 0x54          800           600           256 
  255. 0x56         1024           768            16 
  256. 0x59         1024           768           256 
  257. 0x58         1280          1024            16 
  258.  
  259. AX=MODE
  260.  
  261. =======================================================
  262.  
  263. PARADISE
  264. --------
  265.         width        height        colors 
  266.         -----        ------        ------ 
  267. 0x59          800           600             2 
  268. 0x58          800           600            16 
  269. 0x5e          640           400           256 
  270. 0x5f          640           480           256 
  271. 0x5d         1024           768            16 
  272. 0x5c          800           600           256 
  273.  
  274. AX=MODE
  275.  
  276. =======================================================
  277.  
  278. TRIDENT
  279. -------
  280.         width        height        colors 
  281.         -----        ------        ------ 
  282. 0x5b          800           600            16 
  283. 0x5f         1024           768            16 
  284. 0x5c          640           400           256 
  285. 0x5d          640           480           256 
  286. 0x5e          800           600           256 
  287.  
  288. AX=MODE
  289.  
  290. ==============================